$(function () {
    $('input[name="daterange"]').daterangepicker({
        timePicker: true,
        timePickerIncrement: 30,
        locale: {
            format: 'MM/DD/YYYY h:mm A'
        }
    });
});
/*注册用户接口
    * @param :{}
    **/
function insertUser(){
    var formData = $(".formValide").serializeArray();
    var paramData = {};
    $.each(formData,function(i,v){
        if(v.name === "daterange"){
            var timeDate = v.value.split('-');
            paramData['startTime'] = timeDate[0];
            paramData['endTime'] = timeDate[1];
        }
        paramData[v.name] = v.value;
    });
    $.ajax({
        url: "/rm/insertUser",
        type:"post",
        dataType: 'json',
        // contentType:'application/json',
        data:paramData,
        beforeSend: validateDate,//提交前处理
        success: function(result){
            if(result.status === 0){
                layer.msg(result.msg);
            }else{
                layer.msg(result.msg);
            }
        }, //处理完成
        error: function(res){

        },
        complete:function(){
            layer.close(layerLoad);
        },
    });
}
